package com.pavelk.orion.view.components
{
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.text.*;
	import flash.filters.DropShadowFilter;
	import flash.geom.Rectangle;
	
	import com.pavelk.orion.utils.WindowBlur;

	public class RegistrationView extends BaseView
	{
		private var assetsList:Array = [ "GraphicWindow" ];
		//private var background:Sprite;
		private var windowBlur:WindowBlur;
		private var shadow:DropShadowFilter = new DropShadowFilter( 2, 90, 0x000000, 1, 2, 2, 1, 3 );
		private var dragBounds:Rectangle;
		private var window:Sprite;
		
		public function RegistrationView(  )
		{
			super();
			//background = bg;
		}
		
		public function addAssets( a:Object ) : void
		{
			/*
			for each( var key:String in assetsList )
			{
				var AssetClass:Class = a[key].asset;
            	addChild( new AssetClass() );
			}
			*/
			var AssetClass:Class = a.GraphicWindow.asset;
            window = new AssetClass();
            window.x = 150;
            window.y = 100;

			window.filters = [ shadow ];
 
			//dragBounds = new Rectangle(0, 0, st.stageWidth - window.width, st.stageHeight - window.height);
 			addChild( window );
 			
			//window.addEventListener( MouseEvent.MOUSE_DOWN, pressHandler );
			
			windowBlur = new WindowBlur( background, window, 650, 400 );
			
			super.test("TEST");
			
		}
		
		private function pressHandler( e:MouseEvent ) : void 
		{
			st.addEventListener( MouseEvent.MOUSE_UP, releaseHandler );
			window.startDrag( false, dragBounds );
		}
 
		private function releaseHandler( e:MouseEvent ) : void 
		{
			st.removeEventListener( MouseEvent.MOUSE_UP, releaseHandler );
			window.stopDrag();
		}
		
		private function addLabel() : void
		{
			
		}
		
		private function addInput() : void
		{
			
		}
		
	}
}